using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace UwinEducation.Domain.Entities
{
    /// <summary>
    /// 课程实体
    /// </summary>
    [Table("basic_courses")]
    public class Course : EntityBase
    {
        public Guid Id { get;  set; }
        /// <summary>
        /// 课程编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 课程名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 日历颜色
        /// </summary>
        public string CalendarColor { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }

        /// <summary>
        /// 创建课程
        /// </summary>
        public static Course Create(string code, string name, string calendarColor = null, string remarks = null)
        {
            return new Course
            {
                Id = Guid.NewGuid(),
                Code = code,
                Name = name,
                CalendarColor = calendarColor,
                Remarks = remarks,
                CreatedAt = DateTime.Now
            };
        }
    }
}